# import yaml
#
# file = open("../data/LoginPage.yaml", 'r')
# po_data = yaml.load(file, Loader=yaml.FullLoader)
# po_method = po_data['loginByPassword']
# for step in po_method:
#     print(step['by'])
#     print(step['locator'])
#     print(step['action'])
#     print(step['text'])
# # print(po_data)
# # print(po_method)

# a = {'var1':'18538285467', 'var2':'1'}
#
# b = '$var1'
#
# for k, v in a.items():
#     text = b.replace("$%s" % k, v)
#     # print(k,v)
#     # print(text)
#
#
#     print("sssss$%s" % 'var1', '18538285467')

a = {'var1' : '185385467', 'var2' : '1'}
b = '$var1'
for k, v in a.items():
    c = '$%s' % k
    print(c)
    text = b.replace(c, v) # b.replace(c, v),用v替换b的子字符串c
    print('k =',k,'v =',v, 'text = ', text)